local yixiang = fk.CreateSkill {
  name = "th_yixiang",
  max_phase_use_time = 1,
}

yixiang:addEffect("viewas", {
  pattern = ".|.|.|.|.|normal_trick|.",
  anim_type = "control",
  prompt = "#th_yixiang",
  mute_card = false,
  handly_pile = true,
  interaction = function(self, player)
    local all_names = Fk:getAllCardNames("t")
    local names = player:getViewAsCardNames(yixiang.name, all_names)
    return UI.CardNameBox { choices = names, all_choices = all_names }
  end,
  card_num = 2,
  card_filter = function(self, player, to_select, selected)
    return #selected < 2
  end,
  view_as = function(self, player,cards)
    if #cards ~= 2 or not self.interaction.data then return end
    local card = Fk:cloneCard(self.interaction.data)
    card:addSubcards(cards)
    card.skillName = yixiang.name
    return card
  end,
  enabled_at_play = function(self, player)
    return not player:isNude()
  end,
  enabled_at_response = function(self, player, response)
    return not response and not player:isNude()
  end,
  enabled_at_nullification = function(self, player, data)
    return not player:isNude()
  end
}, { check_skill_limit = true })

Fk:loadTranslationTable{
  ["th_yixiang"] = "异象",
  [":th_yixiang"] = "每阶段限一次，你可以将两张牌当普通锦囊牌使用。",

  ["#th_yixiang"] = "异象：将两张牌当普通锦囊牌使用。",
}

return yixiang